{% extends 'conversejs/includes/base.html' %}
{% block conversejs_baseinclude %}
{% if jid and sid and rid %}
    <script type="text/javascript">
        require(['converse'], function (converse) {
            converse.initialize({
                auto_list_rooms: {{ CONVERSEJS_AUTO_LIST_ROOMS }},
                auto_subscribe: {{ CONVERSEJS_AUTO_SUBSCRIBE }},
                hide_muc_server: {{ CONVERSEJS_HIDE_MUC_SERVER }},
                i18n: locales['{{ LANGUAGE_CODE }}'],
                prebind: {{ CONVERSEJS_PREBIND }},
                show_controlbox_by_default: {{ CONVERSEJS_SHOW_CONTROLBOX_BY_DEFAULT }},
                xhr_user_search: {{ CONVERSEJS_XHR_USER_SEARCH }},
                bosh_service_url: '{{ CONVERSEJS_BOSH_SERVICE_URL }}',
                show_only_online_users: {{ CONVERSEJS_SHOW_ONLY_ONLINE_USERS }},
                allow_contact_requests: {{ CONVERSEJS_ALLOW_CONTACT_REQUESTS }},
                jid: '{{ jid }}',
                sid: '{{ sid }}',
                rid: '{{ rid }}',
                debug: {{ CONVERSEJS_DEBUG }}
            });
        });
    </script>
{% endif %}
{% endblock %}
